package com.magist.core.enums;

/**
 * 用户类型枚兴
 * 
 * @author think
 */
public enum UserTypeEnum implements BaseEnum {
	ADMIN("ADMIN", "管理员"), CORP("CORP", "企业用户"), PERSONAL("PERSONAL", "个人"),CHANNEL("CHANNEL", "渠道"),OP("OP", "操作员");
	private String code; // 编号
	private String desc; // 说明信息

	UserTypeEnum(String code, String desc) {
		this.code = code;
		this.desc = desc;
	}

	public String getCode() {
		return code;
	}

	public String getDesc() {
		return desc;
	}
	
	/**
	 * 从编号得到枚举类
	 * @param code
	 * @return
	 */
	public UserTypeEnum getByCode(String code){
		for(UserTypeEnum e:UserTypeEnum.values()){
			if(e.getCode().equals(code))
				return e;
		}
		return null;
	}
}
